package com.qfhd.soft.cjzcore.Model;

import androidx.annotation.NonNull;

import com.qfhd.soft.cjzcore.Core.CJJsonUtils;

import org.json.JSONObject;

public class CardInfo {
    public static int status_notuse = 0;//没有被使用
    public static int status_open   = 1;//进入过详情页
    public static int status_used   = 2;//使用过了

    public String cards_sn;
    public String ext_info;
    public int status;

    public static CardInfo getModelByJSONObject(JSONObject obj){
        CardInfo cardInfo = new CardInfo();
        cardInfo.cards_sn = CJJsonUtils.getValueFromKey_string(obj,"cards_sn");
        cardInfo.ext_info = CJJsonUtils.getValueFromKey_string(obj,"created_at");
        cardInfo.status = CJJsonUtils.getValueFromKey_int(obj,"status");
        return cardInfo;
    }

    @NonNull
    @Override
    public String toString() {
        return "cards_sn:" + cards_sn + " status:" + status;
    }
}
